import http from "@/utils/request";

/**
 * 查询所有教师
 * @param params
 */
export const getTeacherListApi = <T, K>(params?: T) => http.get<K>("/school/teacher", { params });
/**
 * 查询所有教师options
 * @param params
 */
export const getTeacherOptionsApi = <T, K>(params?: T) => http.get<K>("/school/teacher/options", { params });
/**
 * 查询教师
 * @param params
 */
export const getTeacherApi = <T>(id: number) => http.get<T>(`/school/teacher/${id}`);
/**
 * 新增教师
 * @param data
 */
export const addTeacherApi = <T>(data: T) => http.post("/school/teacher", data);
/**
 * 更新教师
 * @param data
 */
export const updateTeacherApi = <T>(id: number, data: T) => http.patch(`/school/teacher/${id}`, data);
/**
 * 删除教师
 * @param data
 */
export const removeTeacherApi = (id: number) => http.delete(`/school/teacher/${id}`);
/**
 * 导出教师列表
 * @param params
 */
export const exportTeacherListApi = <T>() => http.get<T>(`/school/teacher/export`);
